package xyz.jcat.generator.mybatis.bo;

import xyz.jcat.generator.mybatis.StringConvertUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * javabean字段相关信息
 *
 * @author yueyue
 * @Time 2017-05-15 14:46
 */
@Getter
@Setter
public class JavaField {

    /**
     * 数据库字段名
     */
    private String dbField;
    /**
     * java字段名
     */
    private String beanField;
    /**
     * java字段类型
     */
    private String beanType;
    /**
     * java字段注释
     */
    private String comment;
    /**
     * java字段首字母大写字符串
     */
    private String capitalFieldName;
    /**
     * 该字段是否是主键
     */
    private boolean isPk;
    /**
     * 所用注解
     */
    private List<String> annotations;

    private Object defaultValue;

    public void setBeanField(String beanField) {
        this.beanField = beanField;
        this.capitalFieldName = StringConvertUtils.firstToUppercase(beanField);
    }

}
